package crudfx.interop;
import crudfx.interop.*;
import crudfx.data.*;
import javax.swing.*;
import javafx.scene.*;
import javafx.scene.paint.*;
import java.awt.*;
/**
 * @profile desktop
 * @author Sergey Surikov
 */
public class FXNode extends UIComponent {
    var jPanel:JPanel;
    var jComponent:JComponent;
    public-init var group:Group;
    //public-init var content:Node;// on replace o=n{
        /*jPanel.removeAll();
        if(n!=null){
            var scene:Scene=Scene{
                content:content
                };
            jComponent=crudfx.util.Tools.fromScene(scene);
            jPanel.add(jComponent,java.awt.BorderLayout.CENTER);
            }
        jPanel.validate();*/
        //};
    init{
        jPanel=new JPanel();
        jPanel.setLayout(new BorderLayout());
        jPanel.setOpaque(false);
        var scene:Scene=Scene{
            content:group
	    fill:javafx.scene.paint.Color.web("#ff0000",0.01)
            };
        jComponent=crudfx.util.Tools.fromScene(scene);
        //println(jComponent.getComponentCount());
        jPanel.add(jComponent,java.awt.BorderLayout.CENTER);
        jPanel.validate();
        }
    override public function getJComponent():JComponent{
        return jPanel;
        }
    override public function highlight(s:String):Boolean{
        return false;
        }
    override public function gather():DataTree{
        var me:DataTree=DataTree{ name:"FXNode" };
        return me;
        }
    }
